<?php

namespace App\Repository\Impl;

if (!defined('IN_PX'))
    exit;

use App\Repository\ContactForm;

class ContactFormImpl implements ContactForm {

    //仓储层组件
    private function __Repository($value = 'contactForm') {}

    private function __Inject($db) {}

    public function save($post) {
        $post['add_date'] = time();
        $post['release_date'] = time();
        return $this->db->table('`#@__@contact_form`')
            ->row(array(
                '`name`' => '?',
                '`email`' => '?',
                '`phone`' => '?',
                '`company`' => '?',
                '`message`' => '?',
                '`add_date`' => '?',
                '`release_date`' => '?'
            ))
            ->bind($post)
            ->save();
    }

}
